package cn.webestar.scms.user.api.dto.SysConfig;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.SysConfig;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "SysConfigUpdateDTO")
public class SysConfigUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "父键")
    private String pcode;

    @Schema(description = "键")
    private String code;

    @Schema(description = "值")
    private String val;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "创建人")
    private Long creator;

    @Schema(description = "更新人")
    private Long updater;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public SysConfig toDO() {
        SysConfig o = new SysConfig();
        o.setId(id);
        o.setPcode(pcode);
        o.setCode(code);
        o.setVal(val);
        o.setTitle(title);
        o.setRemark(remark);
        o.setCreator(creator);
        o.setUpdater(updater);
        o.setCreateTime(createTime);
        o.setUpdateTime(updateTime);
        return o;
    }

}
